package com.mdtx.business.service;

import com.mdtx.business.dao.TripMapper;
import com.mdtx.business.entity.po.Trip;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 测试
 *
 * @author 张桂州
 * @create 2017-05-20 15:54
 **/
@Service
public class TestService {

    @Autowired
    private TripMapper mapper;

    public List<Trip> findAll(Trip trip) throws Exception {
        return mapper.findAll(trip);
    }

    public Trip get(Long id) throws Exception {
        return mapper.getTrip(id);
    }

    public void save(Trip trip) throws Exception {
        mapper.saveTrip(trip);
    }

    public void update(Trip trip) throws Exception {
        mapper.updateTrip(trip);
    }

    public void saveAll(List<Trip> trips) throws Exception {
        mapper.saveBatchTrip(trips);
    }

    public void delete(Long id) throws Exception {
        mapper.deleteTrip(id);
    }

    public void deleteAll(List<Long> id) throws Exception {
        mapper.deleteBatchTrip(id);
    }


}
